package com.ruoyi.demo.controller;

import com.ruoyi.demo.pojo.doc.HotelDoc;
import com.ruoyi.demo.pojo.dto.PageResult;
import com.ruoyi.demo.pojo.vo.HotelSearchFormVO;
import com.ruoyi.demo.service.HotelSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/hotel")
public class HotelController {
    @Autowired
    private HotelSearchService hotelSearchService;

    @PostMapping("/search")
    public PageResult<HotelDoc> search(@RequestBody HotelSearchFormVO searchFormVO){
        System.out.println(hotelSearchService.searchHotel(searchFormVO).getList());
        return hotelSearchService.searchHotel(searchFormVO);
    }
}
